# -*- coding:utf-8 -*-

def prompt_str(p_type, enc, **args):
    """提示文字
    """
    text = u'\n'
    if p_type == 'choose_file':
        file_list = args['file_list']
        for i in range(len(file_list)):
            text += u"%d. %s\n" % (i+1, unicode(file_list[i], enc))
            #text = text + unicode(i+1) + u". " + unicode(file_list[i], 'GBK') + u"\n"
        text += u'请选择Excel文件:\n'
    elif p_type == 'choose_sheet':
        sheets = args['sheets']
        for i in range(len(sheets) - 1):
            text += u"%d. %s\n" % (i+1, sheets[i].title)
        text += u'请选择工作表序号:\n'
    elif p_type == 'choose_date':
        dates = args['dates']
        for i in range(len(dates)):
            text += u"%d. %s\n" % (i+1, dates[i].strftime('%Y-%m-%d').encode(enc))
        text += u'请选择日期:\n'
    text += u'>>> '
    return text

def row_is_empty(row):
    """判断是否为空行
    """
    ignore_list = [0]
    for i in range(len(row)):
        if i in ignore_list: continue
        if row[i].value:
            return False
    return True

